///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//
//package CelestialWeb;
//
//import java.io.IOException;
//
//import javax.servlet.ServletException;
//import javax.servlet.http.*;
//import java.util.*;
//
//
//import CelestialDataAccess.*;
//import CelestialWorkflow.*;
///**
// *
// * @author Chuck
// */
//public class CustomerRegisterServlet extends HttpServlet {
//
//    /**
//     * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
//     * @param request servlet request
//     * @param response servlet response
//     * @throws ServletException if a servlet-specific error occurs
//     * @throws IOException if an I/O error occurs
//     */
//    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
//    throws ServletException, IOException {
//        String strEmail = request.getParameter("email");
//        String strPassword = request.getParameter("password");
//        String strFirstname = request.getParameter("firstname");
//        String strLastname = request.getParameter("lastname");
//        String strContact = request.getParameter("contact");
//
//        String strDay = request.getParameter("day");
//        String strMonth = request.getParameter("month");
//        String strYear = request.getParameter("year");
//        Date date=new Date(Integer.parseInt(strYear),Integer.parseInt(strMonth),Integer.parseInt(strDay));
//
//        String strCountry = request.getParameter("country");
//        String strCity = request.getParameter("city");
//        String strState = request.getParameter("state");
//        String address1 = request.getParameter("address");
//        String address2 ="";
//        String strPost = request.getParameter("postalcode");
//
//        String strCcn = request.getParameter("ccn1")+request.getParameter("ccn2")+request.getParameter("ccn3")+request.getParameter("ccn4");
//        String strCct = request.getParameter("cctype");
//        String strCvv = request.getParameter("cccvv");
//        String strCDay = request.getParameter("ccday");
//        String strCMonth = request.getParameter("ccmonth");
//        String strCYear = request.getParameter("ccyear");
//        Date cdate=new Date(Integer.parseInt(strCYear),Integer.parseInt(strCMonth),Integer.parseInt(strCDay));
//
//        String strCch = request.getParameter("ccholder");
//
//        Customer cust=new Customer();
//        cust.setEmail(strEmail);
//        cust.setPassword(strPassword);
//        cust.setFirstName(strFirstname);
//        cust.setLastName(strLastname);
//        cust.setContact(strContact);
//        cust.setDOB(date);
//        cust.setCountry(strCountry);
//        cust.setCity(strCity);
//        cust.setState(strState);
//        cust.setAddressLine1(address1);
//        cust.setAddressLine2(address2);
//        cust.setPostalCode(strPost);
//        cust.setCreditCardNumber(strCcn);
//        cust.setCreditCardType(Integer.parseInt(strCct));
//        cust.setCreditCardCVV(strCvv);
//        cust.setCreditCardExpiry(cdate);
//        cust.setCreditCardHolder(strCch);
//        cust.setUserLevel(1);
//        cust.setActive(Boolean.FALSE);
//
//        RegisterControl rect1 = new RegisterControl();
//        System.out.println(cust.getEmail());
//        if (rect1.insertUser(cust) != -1){ response.sendRedirect("registersuccess.html");
//                                          }
//        else response.sendRedirect("construct.html");
//        try {
//            /* TODO output your page here
//            out.println("<html>");
//            out.println("<head>");
//            out.println("<title>Servlet CustomerRegisterServlet</title>");
//            out.println("</head>");
//            out.println("<body>");
//            out.println("<h1>Servlet CustomerRegisterServlet at " + request.getContextPath () + "</h1>");
//            out.println("</body>");
//            out.println("</html>");
//            */
//        } finally {
//           // out.close();
//        }
//    }
//
//    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
//    /**
//     * Handles the HTTP <code>GET</code> method.
//     * @param request servlet request
//     * @param response servlet response
//     * @throws ServletException if a servlet-specific error occurs
//     * @throws IOException if an I/O error occurs
//     */
//    @Override
//    protected void doGet(HttpServletRequest request, HttpServletResponse response)
//    throws ServletException, IOException {
//        processRequest(request, response);
//    }
//
//    /**
//     * Handles the HTTP <code>POST</code> method.
//     * @param request servlet request
//     * @param response servlet response
//     * @throws ServletException if a servlet-specific error occurs
//     * @throws IOException if an I/O error occurs
//     */
//    @Override
//    protected void doPost(HttpServletRequest request, HttpServletResponse response)
//    throws ServletException, IOException {
//        processRequest(request, response);
//    }
//
//    /**
//     * Returns a short description of the servlet.
//     * @return a String containing servlet description
//     */
//    @Override
//    public String getServletInfo() {
//        return "Short description";
//    }// </editor-fold>
//}
